package org.wk.upms.enums;

/**
 * 资源类型
 */
public enum ResourceType {
	CATALOG("catalog","目录"),
	MENU("menu","菜单"),
	BUTTON("button","按钮");
	private String code;
	private String name;
	private ResourceType(String code, String name) {
		this.code = code;
		this.name = name;
	}
	
	
	public static ResourceType containsCode(String code) {
		for (ResourceType item : ResourceType.values()) {
			if (item.getCode().equals(code)) {
				return item;
			}
		}		
		return null;
	}
			
	/**
	 * @return the code
	 */
	
	public String getCode() {
		return code;
	}
	
	/**
	 * @param code 要设置的 code
	 */
	
	public void setCode(String code) {
		this.code = code;
	}
	/**
	 * @return the name
	 */
	
	public String getName() {
		return name;
	}
	
	/**
	 * @param name 要设置的 name
	 */
	
	public void setName(String name) {
		this.name = name;
	}
	
	
	
	
	
}
